package com.muyu.system.domain.model;


import com.muyu.common.core.web.model.QueryModel;
import com.muyu.system.domain.req.SysUserListReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.Date;

/**
 * 参数配置 分页 模型
 */

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysUserPageQueryModel extends QueryModel<SysUserPageQueryModel> {

    /**
     * 用户昵称
     */
    private String nickName;
    /**
     * 手机号码
     */
    private String phonenumber;
    /**
     * 帐号状态（0正常 1停用）
     */
    private String status;
    /**
     * 开始时间
     */
    private Date beginTime;
    /**
     * 结束时间
     */
    private Date endTime;

    public static SysUserPageQueryModel reqBuild(SysUserListReq sysUserListReq) {
        SysUserPageQueryModel sysUserPageQueryModel = SysUserPageQueryModel.builder()
                .nickName(sysUserListReq.getNickName())
                .phonenumber(sysUserListReq.getPhonenumber())
                .status(sysUserListReq.getStatus())
                .beginTime(sysUserListReq.getBeginTime())
                .endTime(sysUserListReq.getEndTime())
                .build();
        sysUserPageQueryModel.domainBuild(sysUserListReq);
        return sysUserPageQueryModel;
    }
}
